/************************************************************************/
/* Name : Kiwon Yun
/* Partner's name : Eric Rooney
/* File Name : Betting.h
/* The name of assignment : Iteration 2
/************************************************************************/
#ifndef BETTING_H
#define BETTING_H

#include "Player.h"
#include "GameInfo.h"

/************************************************************************/
/* Betting class manages betting.
/************************************************************************/

class Betting
{
public:
	Betting(void);
	virtual ~Betting(void);

	/************************************************************************/
    /* At the start of a round, the players are all required to "ante", 
    /* meaning they are required to place a $1 into the pot.
    /************************************************************************/
	void Ante(Player* pPlayer);

	/************************************************************************/
	/* Raise: # is the amount of money to raise above and beyond the last bet.
	/*This amount plus the last bet must be less than or equal to the amount 
	/*of money the player currently has. - B # 
	/************************************************************************/
	void Raise(Player* pPlayer, int * m_nAmount);
	
	/************************************************************************/
	/*If the player hasn't enough money to call, the player automatically goes
    /* "all in." - C
	/************************************************************************/
	void Call(Player* pPLayer, int m_nPlayersNum);
	
	/************************************************************************/
	/*Fold f
	/************************************************************************/
	void Fold(Player* pPLayer);

	/************************************************************************/
	/*Return the # of calls
	/************************************************************************/
	int GetCalls();

	/************************************************************************/
	/*Set calls to 0
	/************************************************************************/
	void ResetCalls();

	/************************************************************************/
	/*Return # of raises
	/************************************************************************/
	int GetRaises();

	/************************************************************************/
	/*Return last bet
	/************************************************************************/
	int GetLastBet();

	/************************************************************************/
	/*Set raises to 0
	/************************************************************************/
	void ResetRaises();

	/************************************************************************/
	/*Set last bet to 0
	/************************************************************************/
	void ResetLastBet();

	/************************************************************************/
	/*Return # of folds
	/************************************************************************/
	int GetFolds();

	/************************************************************************/
	/*Set folds to 0
	/************************************************************************/
	void ResetFolds();

	/************************************************************************/
    /* Distribute money to the winner
    /************************************************************************/
	void DistributeMoney(Player* pWinner, Player* pSecondWinner);

	/************************************************************************/
    /* Distribute money to the winners in case of tie
    /************************************************************************/
	void TieDistributeMoney(Player* pWinner, int a_nTiedWinnerNum);

	/************************************************************************/
	/*Return # of All ins
	/************************************************************************/
	int GetAllIns();

	/************************************************************************/
	/*Set all ins to 0
	/************************************************************************/
	void ResetAllIns();

	/************************************************************************/
	/*Set all ins, folds, last bet, and so on to 0
	/************************************************************************/
	void ResetAllData();

	/************************************************************************/
	/*Set all in amount to 99999
	/************************************************************************/
	void ResetAllInAmount();

	/************************************************************************/
	/*Set all ins
	/************************************************************************/
	void SetAllIns(int a_nAllIns);

private:
	/*Store size of main pot*/
	int m_nMainPot;
	/*Store size of side pot used for all in*/
	int m_nSidePot;
	/*Store the last bet made*/
	int m_nLastBet;
	/*Store the number of calls made*/
	int m_nCalls;
	/*Store the number of raises made*/
	int m_nRaises;
	/*Store the number of players who have folded*/
	int m_nFolds;
	/*Store the amount that the all in player can get from the main pot*/
	int m_nAllInAmount;
	/*Store the number of all in players*/
	int m_nAllIns;
};

#endif


